﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace WebMvc.App.Web.Default.oracleStruct
{
    public class queryObjectAction  : Controller
	{
		public queryObjectAction(System.IO.TextWriter tw):base(tw){}
		public queryObjectAction(string fileName) : base(fileName) {}
		public queryObjectAction(HttpContext context):base(context){}
		public queryObjectAction(Microsoft.Owin.IOwinContext context):base(context){}
        

        
        
        
        
        public void queryObject()
        {
            var con = new Oracle.ManagedDataAccess.Client.OracleConnection(NFinal.Config.ConfigurationManager.ConnectionStrings["Oracle"].ConnectionString);
			con.Open();
            	#region	var count; 选取首行首列的值
			var __queryObject_count_command__ = new Oracle.ManagedDataAccess.Client.OracleCommand("select count(*) from users", con);
			var count = __queryObject_count_command__.ExecuteScalar().ToInt32();
			__queryObject_count_command__.Dispose();
	#endregion
			
            con.Close();
            Write(count);
        }
        
        
        
    }
}